home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / g / gnu_c / info.lzh / INFO / GCC_INFO.18 < prev    next >
Encoding:
GNU Info File  |  1993-10-21  |  51.0 KB  |  1,114 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.54 from the input
  2. file gcc.texi.
  3.  
  4.    This file documents the use and the internals of the GNU compiler.
  5.  
  6.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the sections entitled "GNU General Public License" and "Protect
  15. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  16. original, and provided that the entire resulting derived work is
  17. distributed under the terms of a permission notice identical to this
  18. one.
  19.  
  20.    Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions, except that the sections entitled "GNU General Public
  23. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  24. permission notice, may be included in translations approved by the Free
  25. Software Foundation instead of in the original English.
  26.  
  27. File: gcc.info,  Node: Condition Code,  Next: Costs,  Prev: Addressing Modes,  Up: Target Macros
  28.  
  29. Condition Code Status
  30. =====================
  31.  
  32.    The file `conditions.h' defines a variable `cc_status' to describe
  33. how the condition code was computed (in case the interpretation of the
  34. condition code depends on the instruction that it was set by).  This
  35. variable contains the RTL expressions on which the condition code is
  36. currently based, and several standard flags.
  37.  
  38.    Sometimes additional machine-specific flags must be defined in the
  39. machine description header file.  It can also add additional
  40. machine-specific information by defining `CC_STATUS_MDEP'.
  41.  
  42. `CC_STATUS_MDEP'
  43.      C code for a data type which is used for declaring the `mdep'
  44.      component of `cc_status'.  It defaults to `int'.
  45.  
  46.      This macro is not used on machines that do not use `cc0'.
  47.  
  48. `CC_STATUS_MDEP_INIT'
  49.      A C expression to initialize the `mdep' field to "empty".  The
  50.      default definition does nothing, since most machines don't use the
  51.      field anyway.  If you want to use the field, you should probably
  52.      define this macro to initialize it.
  53.  
  54.      This macro is not used on machines that do not use `cc0'.
  55.  
  56. `NOTICE_UPDATE_CC (EXP, INSN)'
  57.      A C compound statement to set the components of `cc_status'
  58.      appropriately for an insn INSN whose body is EXP.  It is this
  59.      macro's responsibility to recognize insns that set the condition
  60.      code as a byproduct of other activity as well as those that
  61.      explicitly set `(cc0)'.
  62.  
  63.      This macro is not used on machines that do not use `cc0'.
  64.  
  65.      If there are insns that do not set the condition code but do alter
  66.      other machine registers, this macro must check to see whether they
  67.      invalidate the expressions that the condition code is recorded as
  68.      reflecting.  For example, on the 68000, insns that store in address
  69.      registers do not set the condition code, which means that usually
  70.      `NOTICE_UPDATE_CC' can leave `cc_status' unaltered for such insns.
  71.      But suppose that the previous insn set the condition code based
  72.      on location `a4@(102)' and the current insn stores a new value in
  73.      `a4'.  Although the condition code is not changed by this, it will
  74.      no longer be true that it reflects the contents of `a4@(102)'.
  75.      Therefore, `NOTICE_UPDATE_CC' must alter `cc_status' in this case
  76.      to say that nothing is known about the condition code value.
  77.  
  78.      The definition of `NOTICE_UPDATE_CC' must be prepared to deal with
  79.      the results of peephole optimization: insns whose patterns are
  80.      `parallel' RTXs containing various `reg', `mem' or constants which
  81.      are just the operands.  The RTL structure of these insns is not
  82.      sufficient to indicate what the insns actually do.  What
  83.      `NOTICE_UPDATE_CC' should do when it sees one is just to run
  84.      `CC_STATUS_INIT'.
  85.  
  86.      A possible definition of `NOTICE_UPDATE_CC' is to call a function
  87.      that looks at an attribute (*note Insn Attributes::.) named, for
  88.      example, `cc'.  This avoids having detailed information about
  89.      patterns in two places, the `md' file and in `NOTICE_UPDATE_CC'.
  90.  
  91. `EXTRA_CC_MODES'
  92.      A list of names to be used for additional modes for condition code
  93.      values in registers (*note Jump Patterns::.).  These names are
  94.      added to `enum machine_mode' and all have class `MODE_CC'.  By
  95.      convention, they should start with `CC' and end with `mode'.
  96.  
  97.      You should only define this macro if your machine does not use
  98.      `cc0' and only if additional modes are required.
  99.  
  100. `EXTRA_CC_NAMES'
  101.      A list of C strings giving the names for the modes listed in
  102.      `EXTRA_CC_MODES'.  For example, the Sparc defines this macro and
  103.      `EXTRA_CC_MODES' as
  104.  
  105.           #define EXTRA_CC_MODES CC_NOOVmode, CCFPmode
  106.           #define EXTRA_CC_NAMES "CC_NOOV", "CCFP"
  107.  
  108.      This macro is not required if `EXTRA_CC_MODES' is not defined.
  109.  
  110. `SELECT_CC_MODE (OP, X, Y)'
  111.      Returns a mode from class `MODE_CC' to be used when comparison
  112.      operation code OP is applied to rtx X and Y.  For example, on the
  113.      Sparc, `SELECT_CC_MODE' is defined as (see *note Jump Patterns::.
  114.      for a description of the reason for this definition)
  115.  
  116.           #define SELECT_CC_MODE(OP,X,Y) \
  117.             (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT          \
  118.              ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode)    \
  119.              : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS    \
  120.                  || GET_CODE (X) == NEG) \
  121.                 ? CC_NOOVmode : CCmode))
  122.  
  123.      This macro is not required if `EXTRA_CC_MODES' is not defined.
  124.  
  125. File: gcc.info,  Node: Costs,  Next: Sections,  Prev: Condition Code,  Up: Target Macros
  126.  
  127. Describing Relative Costs of Operations
  128. =======================================
  129.  
  130.    These macros let you describe the relative speed of various
  131. operations on the target machine.
  132.  
  133. `CONST_COSTS (X, CODE, OUTER_CODE)'
  134.      A part of a C `switch' statement that describes the relative costs
  135.      of constant RTL expressions.  It must contain `case' labels for
  136.      expression codes `const_int', `const', `symbol_ref', `label_ref'
  137.      and `const_double'.  Each case must ultimately reach a `return'
  138.      statement to return the relative cost of the use of that kind of
  139.      constant value in an expression.  The cost may depend on the
  140.      precise value of the constant, which is available for examination
  141.      in X, and the rtx code of the expression in which it is contained,
  142.      found in OUTER_CODE.
  143.  
  144.      CODE is the expression code--redundant, since it can be obtained
  145.      with `GET_CODE (X)'.
  146.  
  147. `RTX_COSTS (X, CODE, OUTER_CODE)'
  148.      Like `CONST_COSTS' but applies to nonconstant RTL expressions.
  149.      This can be used, for example, to indicate how costly a multiply
  150.      instruction is.  In writing this macro, you can use the construct
  151.      `COSTS_N_INSNS (N)' to specify a cost equal to N fast
  152.      instructions.  OUTER_CODE is the code of the expression in which X
  153.      is contained.
  154.  
  155.      This macro is optional; do not define it if the default cost
  156.      assumptions are adequate for the target machine.
  157.  
  158. `ADDRESS_COST (ADDRESS)'
  159.      An expression giving the cost of an addressing mode that contains
  160.      ADDRESS.  If not defined, the cost is computed from the ADDRESS
  161.      expression and the `CONST_COSTS' values.
  162.  
  163.      For most CISC machines, the default cost is a good approximation
  164.      of the true cost of the addressing mode.  However, on RISC
  165.      machines, all instructions normally have the same length and
  166.      execution time.  Hence all addresses will have equal costs.
  167.  
  168.      In cases where more than one form of an address is known, the form
  169.      with the lowest cost will be used.  If multiple forms have the
  170.      same, lowest, cost, the one that is the most complex will be used.
  171.  
  172.      For example, suppose an address that is equal to the sum of a
  173.      register and a constant is used twice in the same basic block.
  174.      When this macro is not defined, the address will be computed in a
  175.      register and memory references will be indirect through that
  176.      register.  On machines where the cost of the addressing mode
  177.      containing the sum is no higher than that of a simple indirect
  178.      reference, this will produce an additional instruction and
  179.      possibly require an additional register.  Proper specification of
  180.      this macro eliminates this overhead for such machines.
  181.  
  182.      Similar use of this macro is made in strength reduction of loops.
  183.  
  184.      ADDRESS need not be valid as an address.  In such a case, the cost
  185.      is not relevant and can be any value; invalid addresses need not be
  186.      assigned a different cost.
  187.  
  188.      On machines where an address involving more than one register is as
  189.      cheap as an address computation involving only one register,
  190.      defining `ADDRESS_COST' to reflect this can cause two registers to
  191.      be live over a region of code where only one would have been if
  192.      `ADDRESS_COST' were not defined in that manner.  This effect should
  193.      be considered in the definition of this macro.  Equivalent costs
  194.      should probably only be given to addresses with different numbers
  195.      of registers on machines with lots of registers.
  196.  
  197.      This macro will normally either not be defined or be defined as a
  198.      constant.
  199.  
  200. `REGISTER_MOVE_COST (FROM, TO)'
  201.      A C expression for the cost of moving data from a register in class
  202.      FROM to one in class TO.  The classes are expressed using the
  203.      enumeration values such as `GENERAL_REGS'.  A value of 4 is the
  204.      default; other values are interpreted relative to that.
  205.  
  206.      It is not required that the cost always equal 2 when FROM is the
  207.      same as TO; on some machines it is expensive to move between
  208.      registers if they are not general registers.
  209.  
  210.      If reload sees an insn consisting of a single `set' between two
  211.      hard registers, and if `REGISTER_MOVE_COST' applied to their
  212.      classes returns a value of 2, reload does not check to ensure that
  213.      the constraints of the insn are met.  Setting a cost of other than
  214.      2 will allow reload to verify that the constraints are met.  You
  215.      should do this if the `movM' pattern's constraints do not allow
  216.      such copying.
  217.  
  218. `MEMORY_MOVE_COST (M)'
  219.      A C expression for the cost of moving data of mode M between a
  220.      register and memory.  A value of 2 is the default; this cost is
  221.      relative to those in `REGISTER_MOVE_COST'.
  222.  
  223.      If moving between registers and memory is more expensive than
  224.      between two registers, you should define this macro to express the
  225.      relative cost.
  226.  
  227. `BRANCH_COST'
  228.      A C expression for the cost of a branch instruction.  A value of 1
  229.      is the default; other values are interpreted relative to that.
  230.  
  231.    Here are additional macros which do not specify precise relative
  232. costs, but only that certain actions are more expensive than GNU CC
  233. would ordinarily expect.
  234.  
  235. `SLOW_BYTE_ACCESS'
  236.      Define this macro as a C expression which is nonzero if accessing
  237.      less than a word of memory (i.e. a `char' or a `short') is no
  238.      faster than accessing a word of memory, i.e., if such access
  239.      require more than one instruction or if there is no difference in
  240.      cost between byte and (aligned) word loads.
  241.  
  242.      When this macro is not defined, the compiler will access a field by
  243.      finding the smallest containing object; when it is defined, a
  244.      fullword load will be used if alignment permits.  Unless bytes
  245.      accesses are faster than word accesses, using word accesses is
  246.      preferable since it may eliminate subsequent memory access if
  247.      subsequent accesses occur to other fields in the same word of the
  248.      structure, but to different bytes.
  249.  
  250. `SLOW_ZERO_EXTEND'
  251.      Define this macro if zero-extension (of a `char' or `short' to an
  252.      `int') can be done faster if the destination is a register that is
  253.      known to be zero.
  254.  
  255.      If you define this macro, you must have instruction patterns that
  256.      recognize RTL structures like this:
  257.  
  258.           (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
  259.  
  260.      and likewise for `HImode'.
  261.  
  262. `SLOW_UNALIGNED_ACCESS'
  263.      Define this macro to be the value 1 if unaligned accesses have a
  264.      cost many times greater than aligned accesses, for example if they
  265.      are emulated in a trap handler.
  266.  
  267.      When this macro is non-zero, the compiler will act as if
  268.      `STRICT_ALIGNMENT' were non-zero when generating code for block
  269.      moves.  This can cause significantly more instructions to be
  270.      produced.  Therefore, do not set this macro non-zero if unaligned
  271.      accesses only add a cycle or two to the time for a memory access.
  272.  
  273.      If the value of this macro is always zero, it need not be defined.
  274.  
  275. `DONT_REDUCE_ADDR'
  276.      Define this macro to inhibit strength reduction of memory
  277.      addresses.  (On some machines, such strength reduction seems to do
  278.      harm rather than good.)
  279.  
  280. `MOVE_RATIO'
  281.      The number of scalar move insns which should be generated instead
  282.      of a string move insn or a library call.  Increasing the value
  283.      will always make code faster, but eventually incurs high cost in
  284.      increased code size.
  285.  
  286.      If you don't define this, a reasonable default is used.
  287.  
  288. `NO_FUNCTION_CSE'
  289.      Define this macro if it is as good or better to call a constant
  290.      function address than to call an address kept in a register.
  291.  
  292. `NO_RECURSIVE_FUNCTION_CSE'
  293.      Define this macro if it is as good or better for a function to call
  294.      itself with an explicit address than to call an address kept in a
  295.      register.
  296.  
  297. `ADJUST_COST (INSN, LINK, DEP_INSN, COST)'
  298.      A C statement (sans semicolon) to update the integer variable COST
  299.      based on the relationship between INSN that is dependent on
  300.      DEP_INSN through the dependence LINK.  The default is to make no
  301.      adjustment to COST.  This can be used for example to specify to
  302.      the scheduler that an output- or anti-dependence does not incur
  303.      the same cost as a data-dependence.
  304.  
  305. File: gcc.info,  Node: Sections,  Next: PIC,  Prev: Costs,  Up: Target Macros
  306.  
  307. Dividing the Output into Sections (Texts, Data, ...)
  308. ====================================================
  309.  
  310.    An object file is divided into sections containing different types of
  311. data.  In the most common case, there are three sections: the "text
  312. section", which holds instructions and read-only data; the "data
  313. section", which holds initialized writable data; and the "bss section",
  314. which holds uninitialized data.  Some systems have other kinds of
  315. sections.
  316.  
  317.    The compiler must tell the assembler when to switch sections.  These
  318. macros control what commands to output to tell the assembler this.  You
  319. can also define additional sections.
  320.  
  321. `TEXT_SECTION_ASM_OP'
  322.      A C expression whose value is a string containing the assembler
  323.      operation that should precede instructions and read-only data.
  324.      Normally `".text"' is right.
  325.  
  326. `DATA_SECTION_ASM_OP'
  327.      A C expression whose value is a string containing the assembler
  328.      operation to identify the following data as writable initialized
  329.      data.  Normally `".data"' is right.
  330.  
  331. `SHARED_SECTION_ASM_OP'
  332.      if defined, a C expression whose value is a string containing the
  333.      assembler operation to identify the following data as shared data.
  334.      If not defined, `DATA_SECTION_ASM_OP' will be used.
  335.  
  336. `INIT_SECTION_ASM_OP'
  337.      if defined, a C expression whose value is a string containing the
  338.      assembler operation to identify the following data as
  339.      initialization code.  If not defined, GNU CC will assume such a
  340.      section does not exist.
  341.  
  342. `EXTRA_SECTIONS'
  343.      A list of names for sections other than the standard two, which are
  344.      `in_text' and `in_data'.  You need not define this macro on a
  345.      system with no other sections (that GCC needs to use).
  346.  
  347. `EXTRA_SECTION_FUNCTIONS'
  348.      One or more functions to be defined in `varasm.c'.  These
  349.      functions should do jobs analogous to those of `text_section' and
  350.      `data_section', for your additional sections.  Do not define this
  351.      macro if you do not define `EXTRA_SECTIONS'.
  352.  
  353. `READONLY_DATA_SECTION'
  354.      On most machines, read-only variables, constants, and jump tables
  355.      are placed in the text section.  If this is not the case on your
  356.      machine, this macro should be defined to be the name of a function
  357.      (either `data_section' or a function defined in `EXTRA_SECTIONS')
  358.      that switches to the section to be used for read-only items.
  359.  
  360.      If these items should be placed in the text section, this macro
  361.      should not be defined.
  362.  
  363. `SELECT_SECTION (EXP, RELOC)'
  364.      A C statement or statements to switch to the appropriate section
  365.      for output of EXP.  You can assume that EXP is either a `VAR_DECL'
  366.      node or a constant of some sort.  RELOC indicates whether the
  367.      initial value of EXP requires link-time relocations.  Select the
  368.      section by calling `text_section' or one of the alternatives for
  369.      other sections.
  370.  
  371.      Do not define this macro if you put all read-only variables and
  372.      constants in the read-only data section (usually the text section).
  373.  
  374. `SELECT_RTX_SECTION (MODE, RTX)'
  375.      A C statement or statements to switch to the appropriate section
  376.      for output of RTX in mode MODE.  You can assume that RTX is some
  377.      kind of constant in RTL.  The argument MODE is redundant except in
  378.      the case of a `const_int' rtx.  Select the section by calling
  379.      `text_section' or one of the alternatives for other sections.
  380.  
  381.      Do not define this macro if you put all constants in the read-only
  382.      data section.
  383.  
  384. `JUMP_TABLES_IN_TEXT_SECTION'
  385.      Define this macro if jump tables (for `tablejump' insns) should be
  386.      output in the text section, along with the assembler instructions.
  387.      Otherwise, the readonly data section is used.
  388.  
  389.      This macro is irrelevant if there is no separate readonly data
  390.      section.
  391.  
  392. `ENCODE_SECTION_INFO (DECL)'
  393.      Define this macro if references to a symbol must be treated
  394.      differently depending on something about the variable or function
  395.      named by the symbol (such as what section it is in).
  396.  
  397.      The macro definition, if any, is executed immediately after the
  398.      rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
  399.      The value of the rtl will be a `mem' whose address is a
  400.      `symbol_ref'.
  401.  
  402.      The usual thing for this macro to do is to record a flag in the
  403.      `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
  404.      name string in the `symbol_ref' (if one bit is not enough
  405.      information).
  406.  
  407. `STRIP_NAME_ENCODING (VAR, SYM_NAME)'
  408.      Decode SYM_NAME and store the real name part in VAR, sans the
  409.      characters that encode section info.  Define this macro if
  410.      `ENCODE_SECTION_INFO' alters the symbol's name string.
  411.  
  412. File: gcc.info,  Node: PIC,  Next: Assembler Format,  Prev: Sections,  Up: Target Macros
  413.  
  414. Position Independent Code
  415. =========================
  416.  
  417.    This section describes macros that help implement generation of
  418. position independent code.  Simply defining these macros is not enough
  419. to generate valid PIC; you must also add support to the macros
  420. `GO_IF_LEGITIMATE_ADDRESS' and `PRINT_OPERAND_ADDRESS', as well as
  421. `LEGITIMIZE_ADDRESS'.  You must modify the definition of `movsi' to do
  422. something appropriate when the source operand contains a symbolic
  423. address.  You may also need to alter the handling of switch statements
  424. so that they use relative addresses.
  425.  
  426. `PIC_OFFSET_TABLE_REGNUM'
  427.      The register number of the register used to address a table of
  428.      static data addresses in memory.  In some cases this register is
  429.      defined by a processor's "application binary interface" (ABI).
  430.      When this macro is defined, RTL is generated for this register
  431.      once, as with the stack pointer and frame pointer registers.  If
  432.      this macro is not defined, it is up to the machine-dependent files
  433.      to allocate such a register (if necessary).
  434.  
  435. `FINALIZE_PIC'
  436.      By generating position-independent code, when two different
  437.      programs (A and B) share a common library (libC.a), the text of
  438.      the library can be shared whether or not the library is linked at
  439.      the same address for both programs.  In some of these
  440.      environments, position-independent code requires not only the use
  441.      of different addressing modes, but also special code to enable the
  442.      use of these addressing modes.
  443.  
  444.      The `FINALIZE_PIC' macro serves as a hook to emit these special
  445.      codes once the function is being compiled into assembly code, but
  446.      not before.  (It is not done before, because in the case of
  447.      compiling an inline function, it would lead to multiple PIC
  448.      prologues being included in functions which used inline functions
  449.      and were compiled to assembly language.)
  450.  
  451. `LEGITIMATE_PIC_OPERAND_P (X)'
  452.      A C expression that is nonzero if X is a legitimate immediate
  453.      operand on the target machine when generating position independent
  454.      code.  You can assume that X satisfies `CONSTANT_P', so you need
  455.      not check this.  You can also assume FLAG_PIC is true, so you need
  456.      not check it either.  You need not define this macro if all
  457.      constants (including `SYMBOL_REF') can be immediate operands when
  458.      generating position independent code.
  459.  
  460. File: gcc.info,  Node: Assembler Format,  Next: Debugging Info,  Prev: PIC,  Up: Target Macros
  461.  
  462. Defining the Output Assembler Language
  463. ======================================
  464.  
  465.    This section describes macros whose principal purpose is to describe
  466. how to write instructions in assembler language-rather than what the
  467. instructions do.
  468.  
  469. * Menu:
  470.  
  471. * File Framework::       Structural information for the assembler file.
  472. * Data Output::          Output of constants (numbers, strings, addresses).
  473. * Uninitialized Data::   Output of uninitialized variables.
  474. * Label Output::         Output and generation of labels.
  475. * Initialization::       General principles of initialization
  476.                and termination routines.
  477. * Macros for Initialization::
  478.              Specific macros that control the handling of
  479.                initialization and termination routines.
  480. * Instruction Output::   Output of actual instructions.
  481. * Dispatch Tables::      Output of jump tables.
  482. * Alignment Output::     Pseudo ops for alignment and skipping data.
  483.  
  484. File: gcc.info,  Node: File Framework,  Next: Data Output,  Up: Assembler Format
  485.  
  486. The Overall Framework of an Assembler File
  487. ------------------------------------------
  488.  
  489. `ASM_FILE_START (STREAM)'
  490.      A C expression which outputs to the stdio stream STREAM some
  491.      appropriate text to go at the start of an assembler file.
  492.  
  493.      Normally this macro is defined to output a line containing
  494.      `#NO_APP', which is a comment that has no effect on most
  495.      assemblers but tells the GNU assembler that it can save time by not
  496.      checking for certain assembler constructs.
  497.  
  498.      On systems that use SDB, it is necessary to output certain
  499.      commands; see `attasm.h'.
  500.  
  501. `ASM_FILE_END (STREAM)'
  502.      A C expression which outputs to the stdio stream STREAM some
  503.      appropriate text to go at the end of an assembler file.
  504.  
  505.      If this macro is not defined, the default is to output nothing
  506.      special at the end of the file.  Most systems don't require any
  507.      definition.
  508.  
  509.      On systems that use SDB, it is necessary to output certain
  510.      commands; see `attasm.h'.
  511.  
  512. `ASM_IDENTIFY_GCC (FILE)'
  513.      A C statement to output assembler commands which will identify the
  514.      object file as having been compiled with GNU CC (or another GNU
  515.      compiler).
  516.  
  517.      If you don't define this macro, the string `gcc_compiled.:' is
  518.      output.  This string is calculated to define a symbol which, on
  519.      BSD systems, will never be defined for any other reason.  GDB
  520.      checks for the presence of this symbol when reading the symbol
  521.      table of an executable.
  522.  
  523.      On non-BSD systems, you must arrange communication with GDB in
  524.      some other fashion.  If GDB is not used on your system, you can
  525.      define this macro with an empty body.
  526.  
  527. `ASM_COMMENT_START'
  528.      A C string constant describing how to begin a comment in the target
  529.      assembler language.  The compiler assumes that the comment will
  530.      end at the end of the line.
  531.  
  532. `ASM_APP_ON'
  533.      A C string constant for text to be output before each `asm'
  534.      statement or group of consecutive ones.  Normally this is
  535.      `"#APP"', which is a comment that has no effect on most assemblers
  536.      but tells the GNU assembler that it must check the lines that
  537.      follow for all valid assembler constructs.
  538.  
  539. `ASM_APP_OFF'
  540.      A C string constant for text to be output after each `asm'
  541.      statement or group of consecutive ones.  Normally this is
  542.      `"#NO_APP"', which tells the GNU assembler to resume making the
  543.      time-saving assumptions that are valid for ordinary compiler
  544.      output.
  545.  
  546. `ASM_OUTPUT_SOURCE_FILENAME (STREAM, NAME)'
  547.      A C statement to output COFF information or DWARF debugging
  548.      information which indicates that filename NAME is the current
  549.      source file to the stdio stream STREAM.
  550.  
  551.      This macro need not be defined if the standard form of output for
  552.      the file format in use is appropriate.
  553.  
  554. `ASM_OUTPUT_SOURCE_LINE (STREAM, LINE)'
  555.      A C statement to output DBX or SDB debugging information before
  556.      code for line number LINE of the current source file to the stdio
  557.      stream STREAM.
  558.  
  559.      This macro need not be defined if the standard form of debugging
  560.      information for the debugger in use is appropriate.
  561.  
  562. `ASM_OUTPUT_IDENT (STREAM, STRING)'
  563.      A C statement to output something to the assembler file to handle a
  564.      `#ident' directive containing the text STRING.  If this macro is
  565.      not defined, nothing is output for a `#ident' directive.
  566.  
  567. `OBJC_PROLOGUE'
  568.      A C statement to output any assembler statements which are
  569.      required to precede any Objective C object definitions or message
  570.      sending.  The statement is executed only when compiling an
  571.      Objective C program.
  572.  
  573. File: gcc.info,  Node: Data Output,  Next: Uninitialized Data,  Prev: File Framework,  Up: Assembler Format
  574.  
  575. Output of Data
  576. --------------
  577.  
  578. `ASM_OUTPUT_LONG_DOUBLE (STREAM, VALUE)'
  579. `ASM_OUTPUT_DOUBLE (STREAM, VALUE)'
  580. `ASM_OUTPUT_FLOAT (STREAM, VALUE)'
  581.      A C statement to output to the stdio stream STREAM an assembler
  582.      instruction to assemble a floating-point constant of `TFmode',
  583.      `DFmode' or `SFmode', respectively, whose value is VALUE.  VALUE
  584.      will be a C expression of type `REAL_VALUE_TYPE'.  Macros such as
  585.      `REAL_VALUE_TO_TARGET_DOUBLE' are useful for writing these
  586.      definitions.
  587.  
  588. `ASM_OUTPUT_QUADRUPLE_INT (STREAM, EXP)'
  589. `ASM_OUTPUT_DOUBLE_INT (STREAM, EXP)'
  590. `ASM_OUTPUT_INT (STREAM, EXP)'
  591. `ASM_OUTPUT_SHORT (STREAM, EXP)'
  592. `ASM_OUTPUT_CHAR (STREAM, EXP)'
  593.      A C statement to output to the stdio stream STREAM an assembler
  594.      instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
  595.      respectively, whose value is VALUE.  The argument EXP will be an
  596.      RTL expression which represents a constant value.  Use
  597.      `output_addr_const (STREAM, EXP)' to output this value as an
  598.      assembler expression.
  599.  
  600.      For sizes larger than `UNITS_PER_WORD', if the action of a macro
  601.      would be identical to repeatedly calling the macro corresponding to
  602.      a size of `UNITS_PER_WORD', once for each word, you need not define
  603.      the macro.
  604.  
  605. `ASM_OUTPUT_BYTE (STREAM, VALUE)'
  606.      A C statement to output to the stdio stream STREAM an assembler
  607.      instruction to assemble a single byte containing the number VALUE.
  608.  
  609. `ASM_BYTE_OP'
  610.      A C string constant giving the pseudo-op to use for a sequence of
  611.      single-byte constants.  If this macro is not defined, the default
  612.      is `"byte"'.
  613.  
  614. `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)'
  615.      A C statement to output to the stdio stream STREAM an assembler
  616.      instruction to assemble a string constant containing the LEN bytes
  617.      at PTR.  PTR will be a C expression of type `char *' and LEN a C
  618.      expression of type `int'.
  619.  
  620.      If the assembler has a `.ascii' pseudo-op as found in the Berkeley
  621.      Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'.
  622.  
  623. `ASM_OUTPUT_POOL_PROLOGUE (FILE FUNNAME FUNDECL SIZE)'
  624.      A C statement to output assembler commands to define the start of
  625.      the constant pool for a function.  FUNNAME is a string giving the
  626.      name of the function.  Should the return type of the function be
  627.      required, it can be obtained via FUNDECL.  SIZE is the size, in
  628.      bytes, of the constant pool that will be written immediately after
  629.      this call.
  630.  
  631.      If no constant-pool prefix is required, the usual case, this macro
  632.      need not be defined.
  633.  
  634. `ASM_OUTPUT_SPECIAL_POOL_ENTRY (FILE, X, MODE, ALIGN, LABELNO, JUMPTO)'
  635.      A C statement (with or without semicolon) to output a constant in
  636.      the constant pool, if it needs special treatment.  (This macro
  637.      need not do anything for RTL expressions that can be output
  638.      normally.)
  639.  
  640.      The argument FILE is the standard I/O stream to output the
  641.      assembler code on.  X is the RTL expression for the constant to
  642.      output, and MODE is the machine mode (in case X is a `const_int').
  643.      ALIGN is the required alignment for the value X; you should
  644.      output an assembler directive to force this much alignment.
  645.  
  646.      The argument LABELNO is a number to use in an internal label for
  647.      the address of this pool entry.  The definition of this macro is
  648.      responsible for outputting the label definition at the proper
  649.      place.  Here is how to do this:
  650.  
  651.           ASM_OUTPUT_INTERNAL_LABEL (FILE, "LC", LABELNO);
  652.  
  653.      When you output a pool entry specially, you should end with a
  654.      `goto' to the label JUMPTO.  This will prevent the same pool entry
  655.      from being output a second time in the usual manner.
  656.  
  657.      You need not define this macro if it would do nothing.
  658.  
  659. `ASM_OPEN_PAREN'
  660. `ASM_CLOSE_PAREN'
  661.      These macros are defined as C string constant, describing the
  662.      syntax in the assembler for grouping arithmetic expressions.  The
  663.      following definitions are correct for most assemblers:
  664.  
  665.           #define ASM_OPEN_PAREN "("
  666.           #define ASM_CLOSE_PAREN ")"
  667.  
  668.    These macros are provided by `real.h' for writing the definitions of
  669. `ASM_OUTPUT_DOUBLE' and the like:
  670.  
  671. `REAL_VALUE_TO_TARGET_SINGLE (X, L)'
  672. `REAL_VALUE_TO_TARGET_DOUBLE (X, L)'
  673. `REAL_VALUE_TO_TARGET_LONG_DOUBLE (X, L)'
  674.      These translate X, of type `REAL_VALUE_TYPE', to the target's
  675.      floating point representation, and store its bit pattern in the
  676.      array of `long int' whose address is L.  The number of elements in
  677.      the output array is determined by the size of the desired target
  678.      floating point data type: 32 bits of it go in each `long int' array
  679.      element.  Each array element holds 32 bits of the result, even if
  680.      `long int' is wider than 32 bits on the host machine.
  681.  
  682.      The array element values are designed so that you can print them
  683.      out using `fprintf' in the order they should appear in the target
  684.      machine's memory.
  685.  
  686. `REAL_VALUE_TO_DECIMAL (X, FORMAT, STRING)'
  687.      This macro converts X, of type `REAL_VALUE_TYPE', to a decimal
  688.      number and stores it as a string into STRING.  You must pass, as
  689.      STRING, the address of a long enough block of space to hold the
  690.      result.
  691.  
  692.      The argument FORMAT is a `printf'-specification that serves as a
  693.      suggestion for how to format the output string.
  694.  
  695. File: gcc.info,  Node: Uninitialized Data,  Next: Label Output,  Prev: Data Output,  Up: Assembler Format
  696.  
  697. Output of Uninitialized Variables
  698. ---------------------------------
  699.  
  700.    Each of the macros in this section is used to do the whole job of
  701. outputting a single uninitialized variable.
  702.  
  703. `ASM_OUTPUT_COMMON (STREAM, NAME, SIZE, ROUNDED)'
  704.      A C statement (sans semicolon) to output to the stdio stream
  705.      STREAM the assembler definition of a common-label named NAME whose
  706.      size is SIZE bytes.  The variable ROUNDED is the size rounded up
  707.      to whatever alignment the caller wants.
  708.  
  709.      Use the expression `assemble_name (STREAM, NAME)' to output the
  710.      name itself; before and after that, output the additional
  711.      assembler syntax for defining the name, and a newline.
  712.  
  713.      This macro controls how the assembler definitions of uninitialized
  714.      global variables are output.
  715.  
  716. `ASM_OUTPUT_ALIGNED_COMMON (STREAM, NAME, SIZE, ALIGNMENT)'
  717.      Like `ASM_OUTPUT_COMMON' except takes the required alignment as a
  718.      separate, explicit argument.  If you define this macro, it is used
  719.      in place of `ASM_OUTPUT_COMMON', and gives you more flexibility in
  720.      handling the required alignment of the variable.
  721.  
  722. `ASM_OUTPUT_SHARED_COMMON (STREAM, NAME, SIZE, ROUNDED)'
  723.      If defined, it is similar to `ASM_OUTPUT_COMMON', except that it
  724.      is used when NAME is shared.  If not defined, `ASM_OUTPUT_COMMON'
  725.      will be used.
  726.  
  727. `ASM_OUTPUT_LOCAL (STREAM, NAME, SIZE, ROUNDED)'
  728.      A C statement (sans semicolon) to output to the stdio stream
  729.      STREAM the assembler definition of a local-common-label named NAME
  730.      whose size is SIZE bytes.  The variable ROUNDED is the size
  731.      rounded up to whatever alignment the caller wants.
  732.  
  733.      Use the expression `assemble_name (STREAM, NAME)' to output the
  734.      name itself; before and after that, output the additional
  735.      assembler syntax for defining the name, and a newline.
  736.  
  737.      This macro controls how the assembler definitions of uninitialized
  738.      static variables are output.
  739.  
  740. `ASM_OUTPUT_ALIGNED_LOCAL (STREAM, NAME, SIZE, ALIGNMENT)'
  741.      Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a
  742.      separate, explicit argument.  If you define this macro, it is used
  743.      in place of `ASM_OUTPUT_LOCAL', and gives you more flexibility in
  744.      handling the required alignment of the variable.
  745.  
  746. `ASM_OUTPUT_SHARED_LOCAL (STREAM, NAME, SIZE, ROUNDED)'
  747.      If defined, it is similar to `ASM_OUTPUT_LOCAL', except that it is
  748.      used when NAME is shared.  If not defined, `ASM_OUTPUT_LOCAL' will
  749.      be used.
  750.  
  751. File: gcc.info,  Node: Label Output,  Next: Initialization,  Prev: Uninitialized Data,  Up: Assembler Format
  752.  
  753. Output and Generation of Labels
  754. -------------------------------
  755.  
  756. `ASM_OUTPUT_LABEL (STREAM, NAME)'
  757.      A C statement (sans semicolon) to output to the stdio stream
  758.      STREAM the assembler definition of a label named NAME.  Use the
  759.      expression `assemble_name (STREAM, NAME)' to output the name
  760.      itself; before and after that, output the additional assembler
  761.      syntax for defining the name, and a newline.
  762.  
  763. `ASM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL)'
  764.      A C statement (sans semicolon) to output to the stdio stream
  765.      STREAM any text necessary for declaring the name NAME of a
  766.      function which is being defined.  This macro is responsible for
  767.      outputting the label definition (perhaps using
  768.      `ASM_OUTPUT_LABEL').  The argument DECL is the `FUNCTION_DECL'
  769.      tree node representing the function.
  770.  
  771.      If this macro is not defined, then the function name is defined in
  772.      the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
  773.  
  774. `ASM_DECLARE_FUNCTION_SIZE (STREAM, NAME, DECL)'
  775.      A C statement (sans semicolon) to output to the stdio stream
  776.      STREAM any text necessary for declaring the size of a function
  777.      which is being defined.  The argument NAME is the name of the
  778.      function.  The argument DECL is the `FUNCTION_DECL' tree node
  779.      representing the function.
  780.  
  781.      If this macro is not defined, then the function size is not
  782.      defined.
  783.  
  784. `ASM_DECLARE_OBJECT_NAME (STREAM, NAME, DECL)'
  785.      A C statement (sans semicolon) to output to the stdio stream
  786.      STREAM any text necessary for declaring the name NAME of an
  787.      initialized variable which is being defined.  This macro must
  788.      output the label definition (perhaps using `ASM_OUTPUT_LABEL').
  789.      The argument DECL is the `VAR_DECL' tree node representing the
  790.      variable.
  791.  
  792.      If this macro is not defined, then the variable name is defined in
  793.      the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
  794.  
  795. `ASM_GLOBALIZE_LABEL (STREAM, NAME)'
  796.      A C statement (sans semicolon) to output to the stdio stream
  797.      STREAM some commands that will make the label NAME global; that
  798.      is, available for reference from other files.  Use the expression
  799.      `assemble_name (STREAM, NAME)' to output the name itself; before
  800.      and after that, output the additional assembler syntax for making
  801.      that name global, and a newline.
  802.  
  803. `ASM_OUTPUT_EXTERNAL (STREAM, DECL, NAME)'
  804.      A C statement (sans semicolon) to output to the stdio stream
  805.      STREAM any text necessary for declaring the name of an external
  806.      symbol named NAME which is referenced in this compilation but not
  807.      defined.  The value of DECL is the tree node for the declaration.
  808.  
  809.      This macro need not be defined if it does not need to output
  810.      anything.  The GNU assembler and most Unix assemblers don't
  811.      require anything.
  812.  
  813. `ASM_OUTPUT_EXTERNAL_LIBCALL (STREAM, SYMREF)'
  814.      A C statement (sans semicolon) to output on STREAM an assembler
  815.      pseudo-op to declare a library function name external.  The name
  816.      of the library function is given by SYMREF, which has type `rtx'
  817.      and is a `symbol_ref'.
  818.  
  819.      This macro need not be defined if it does not need to output
  820.      anything.  The GNU assembler and most Unix assemblers don't
  821.      require anything.
  822.  
  823. `ASM_OUTPUT_LABELREF (STREAM, NAME)'
  824.      A C statement (sans semicolon) to output to the stdio stream
  825.      STREAM a reference in assembler syntax to a label named NAME.
  826.      This should add `_' to the front of the name, if that is customary
  827.      on your operating system, as it is in most Berkeley Unix systems.
  828.      This macro is used in `assemble_name'.
  829.  
  830. `ASM_OUTPUT_LABELREF_AS_INT (FILE, LABEL)'
  831.      Define this macro for systems that use the program `collect2'.
  832.      The definition should be a C statement to output a word containing
  833.      a reference to the label LABEL.
  834.  
  835. `ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM)'
  836.      A C statement to output to the stdio stream STREAM a label whose
  837.      name is made from the string PREFIX and the number NUM.
  838.  
  839.      It is absolutely essential that these labels be distinct from the
  840.      labels used for user-level functions and variables.  Otherwise,
  841.      certain programs will have name conflicts with internal labels.
  842.  
  843.      It is desirable to exclude internal labels from the symbol table
  844.      of the object file.  Most assemblers have a naming convention for
  845.      labels that should be excluded; on many systems, the letter `L' at
  846.      the beginning of a label has this effect.  You should find out what
  847.      convention your system uses, and follow it.
  848.  
  849.      The usual definition of this macro is as follows:
  850.  
  851.           fprintf (STREAM, "L%s%d:\n", PREFIX, NUM)
  852.  
  853. `ASM_GENERATE_INTERNAL_LABEL (STRING, PREFIX, NUM)'
  854.      A C statement to store into the string STRING a label whose name
  855.      is made from the string PREFIX and the number NUM.
  856.  
  857.      This string, when output subsequently by `assemble_name', should
  858.      produce the output that `ASM_OUTPUT_INTERNAL_LABEL' would produce
  859.      with the same PREFIX and NUM.
  860.  
  861.      If the string begins with `*', then `assemble_name' will output
  862.      the rest of the string unchanged.  It is often convenient for
  863.      `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way.  If the
  864.      string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to
  865.      output the string, and may change it.  (Of course,
  866.      `ASM_OUTPUT_LABELREF' is also part of your machine description, so
  867.      you should know what it does on your machine.)
  868.  
  869. `ASM_FORMAT_PRIVATE_NAME (OUTVAR, NAME, NUMBER)'
  870.      A C expression to assign to OUTVAR (which is a variable of type
  871.      `char *') a newly allocated string made from the string NAME and
  872.      the number NUMBER, with some suitable punctuation added.  Use
  873.      `alloca' to get space for the string.
  874.  
  875.      The string will be used as an argument to `ASM_OUTPUT_LABELREF' to
  876.      produce an assembler label for an internal static variable whose
  877.      name is NAME.  Therefore, the string must be such as to result in
  878.      valid assembler code.  The argument NUMBER is different each time
  879.      this macro is executed; it prevents conflicts between
  880.      similarly-named internal static variables in different scopes.
  881.  
  882.      Ideally this string should not be a valid C identifier, to prevent
  883.      any conflict with the user's own symbols.  Most assemblers allow
  884.      periods or percent signs in assembler symbols; putting at least
  885.      one of these between the name and the number will suffice.
  886.  
  887. `OBJC_GEN_METHOD_LABEL (BUF, IS_INST, CLASS_NAME, CAT_NAME, SEL_NAME)'
  888.      Define this macro to override the default assembler names used for
  889.      Objective C methods.
  890.  
  891.      The default name is a unique method number followed by the name of
  892.      the class (e.g. `_1_Foo').  For methods in categories, the name of
  893.      the category is also included in the assembler name (e.g.
  894.      `_1_Foo_Bar').
  895.  
  896.      These names are safe on most systems, but make debugging difficult
  897.      since the method's selector is not present in the name.
  898.      Therefore, particular systems define other ways of computing names.
  899.  
  900.      BUF is an expression of type `char *' which gives you a buffer in
  901.      which to store the name; its length is as long as CLASS_NAME,
  902.      CAT_NAME and SEL_NAME put together, plus 50 characters extra.
  903.  
  904.      The argument IS_INST specifies whether the method is an instance
  905.      method or a class method; CLASS_NAME is the name of the class;
  906.      CAT_NAME is the name of the category (or NULL if the method is not
  907.      in a category); and SEL_NAME is the name of the selector.
  908.  
  909.      On systems where the assembler can handle quoted names, you can
  910.      use this macro to provide more human-readable names.
  911.  
  912. File: gcc.info,  Node: Initialization,  Next: Macros for Initialization,  Prev: Label Output,  Up: Assembler Format
  913.  
  914. How Initialization Functions Are Handled
  915. ----------------------------------------
  916.  
  917.    The compiled code for certain languages includes "constructors"
  918. (also called "initialization routines")--functions to initialize data
  919. in the program when the program is started.  These functions need to be
  920. called before the program is "started"--that is to say, before `main'
  921. is called.
  922.  
  923.    Compiling some languages generates "destructors" (also called
  924. "termination routines") that should be called when the program
  925. terminates.
  926.  
  927.    To make the initialization and termination functions work, the
  928. compiler must output something in the assembler code to cause those
  929. functions to be called at the appropriate time.  When you port the
  930. compiler to a new system, you need to specify how to do this.
  931.  
  932.    There are two major ways that GCC currently supports the execution of
  933. initialization and termination functions.  Each way has two variants.
  934. Much of the structure is common to all four variations.
  935.  
  936.    The linker must build two lists of these functions--a list of
  937. initialization functions, called `__CTOR_LIST__', and a list of
  938. termination functions, called `__DTOR_LIST__'.
  939.  
  940.    Each list always begins with an ignored function pointer (which may
  941. hold 0, -1, or a count of the function pointers after it, depending on
  942. the environment).  This is followed by a series of zero or more function
  943. pointers to constructors (or destructors), followed by a function
  944. pointer containing zero.
  945.  
  946.    Depending on the operating system and its executable file format,
  947. either `crtstuff.c' or `libgcc2.c' traverses these lists at startup
  948. time and exit time.  Constructors are called in forward order of the
  949. list; destructors in reverse order.
  950.  
  951.    The best way to handle static constructors works only for object file
  952. formats which provide arbitrarily-named sections.  A section is set
  953. aside for a list of constructors, and another for a list of destructors.
  954. Traditionally these are called `.ctors' and `.dtors'.  Each object file
  955. that defines an initialization function also puts a word in the
  956. constructor section to point to that function.  The linker accumulates
  957. all these words into one contiguous `.ctors' section.  Termination
  958. functions are handled similarly.
  959.  
  960.    To use this method, you need appropriate definitions of the macros
  961. `ASM_OUTPUT_CONSTRUCTOR' and `ASM_OUTPUT_DESTRUCTOR'.  Usually you can
  962. get them by including `svr4.h'.
  963.  
  964.    When arbitrary sections are available, there are two variants,
  965. depending upon how the code in `crtstuff.c' is called.  On systems that
  966. support an "init" section which is executed at program startup, parts
  967. of `crtstuff.c' are compiled into that section.  The program is linked
  968. by the `gcc' driver like this:
  969.  
  970.      ld -o OUTPUT_FILE crtbegin.o ... crtend.o -lgcc
  971.  
  972.    The head of a function (`__do_global_ctors') appears in the init
  973. section of `crtbegin.o'; the remainder of the function appears in the
  974. init section of `crtend.o'.  The linker will pull these two parts of
  975. the section together, making a whole function.  If any of the user's
  976. object files linked into the middle of it contribute code, then that
  977. code will be executed as part of the body of `__do_global_ctors'.
  978.  
  979.    To use this variant, you must define the `INIT_SECTION_ASM_OP' macro
  980. properly.
  981.  
  982.    If no init section is available, do not define
  983. `INIT_SECTION_ASM_OP'.  Then `__do_global_ctors' is built into the text
  984. section like all other functions, and resides in `libgcc.a'.  When GCC
  985. compiles any function called `main', it inserts a procedure call to
  986. `__main' as the first executable code after the function prologue.  The
  987. `__main' function, also defined in `libgcc2.c', simply calls
  988. `__do_global_ctors'.
  989.  
  990.    In file formats that don't support arbitrary sections, there are
  991. again two variants.  In the simplest variant, the GNU linker (GNU `ld')
  992. and an `a.out' format must be used.  In this case,
  993. `ASM_OUTPUT_CONSTRUCTOR' is defined to produce a `.stabs' entry of type
  994. `N_SETT', referencing the name `__CTOR_LIST__', and with the address of
  995. the void function containing the initialization code as its value.  The
  996. GNU linker recognizes this as a request to add the value to a "set";
  997. the values are accumulated, and are eventually placed in the executable
  998. as a vector in the format described above, with a leading (ignored)
  999. count and a trailing zero element.  `ASM_OUTPUT_DESTRUCTOR' is handled
  1000. similarly.  Since no init section is available, the absence of
  1001. `INIT_SECTION_ASM_OP' causes the compilation of `main' to call `__main'
  1002. as above, starting the initialization process.
  1003.  
  1004.    The last variant uses neither arbitrary sections nor the GNU linker.
  1005. This is preferable when you want to do dynamic linking and when using
  1006. file formats which the GNU linker does not support, such as `ECOFF'.  In
  1007. this case, `ASM_OUTPUT_CONSTRUCTOR' does not produce an `N_SETT'
  1008. symbol; initialization and termination functions are recognized simply
  1009. by their names.  This requires an extra program in the linkage step,
  1010. called `collect2'.  This program pretends to be the linker, for use
  1011. with GNU CC; it does its job by running the ordinary linker, but also
  1012. arranges to include the vectors of initialization and termination
  1013. functions.  These functions are called via `__main' as described above.
  1014.  
  1015.    Choosing among these configuration options has been simplified by a
  1016. set of operating-system-dependent files in the `config' subdirectory.
  1017. These files define all of the relevant parameters.  Usually it is
  1018. sufficient to include one into your specific machine-dependent
  1019. configuration file.  These files are:
  1020.  
  1021. `aoutos.h'
  1022.      For operating systems using the `a.out' format.
  1023.  
  1024. `next.h'
  1025.      For operating systems using the `MachO' format.
  1026.  
  1027. `svr3.h'
  1028.      For System V Release 3 and similar systems using `COFF' format.
  1029.  
  1030. `svr4.h'
  1031.      For System V Release 4 and similar systems using `ELF' format.
  1032.  
  1033. `vms.h'
  1034.      For the VMS operating system.
  1035.  
  1036.    The following section describes the specific macros that control and
  1037. customize the handling of initialization and termination functions.
  1038.  
  1039. File: gcc.info,  Node: Macros for Initialization,  Next: Instruction Output,  Prev: Initialization,  Up: Assembler Format
  1040.  
  1041. Macros Controlling Initialization Routines
  1042. ------------------------------------------
  1043.  
  1044.    Here are the macros that control how the compiler handles
  1045. initialization and termination functions:
  1046.  
  1047. `INIT_SECTION_ASM_OP'
  1048.      If defined, a C string constant for the assembler operation to
  1049.      identify the following data as initialization code.  If not
  1050.      defined, GNU CC will assume such a section does not exist.  When
  1051.      you are using special sections for initialization and termination
  1052.      functions, this macro also controls how `crtstuff.c' and
  1053.      `libgcc2.c' arrange to run the initialization functions.
  1054.  
  1055. `ASM_OUTPUT_CONSTRUCTOR (STREAM, NAME)'
  1056.      Define this macro as a C statement to output on the stream STREAM
  1057.      the assembler code to arrange to call the function named NAME at
  1058.      initialization time.
  1059.  
  1060.      Assume that NAME is the name of a C function generated
  1061.      automatically by the compiler.  This function takes no arguments.
  1062.      Use the function `assemble_name' to output the name NAME; this
  1063.      performs any system-specific syntactic transformations such as
  1064.      adding an underscore.
  1065.  
  1066.      If you don't define this macro, nothing special is output to
  1067.      arrange to call the function.  This is correct when the function
  1068.      will be called in some other manner--for example, by means of the
  1069.      `collect2' program, which looks through the symbol table to find
  1070.      these functions by their names.  If you want to use `collect2',
  1071.      then you need to arrange for it to be built and installed and used
  1072.      on your system.
  1073.  
  1074. `ASM_OUTPUT_DESTRUCTOR (STREAM, NAME)'
  1075.      This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination
  1076.      functions rather than initialization functions.
  1077.  
  1078.    If your system uses `collect2' as the means of processing
  1079. constructors, then that program normally uses `nm' to scan an object
  1080. file for constructor functions to be called.  On certain kinds of
  1081. systems, you can define these macros to make `collect2' work faster
  1082. (and, in some cases, make it work at all):
  1083.  
  1084. `OBJECT_FORMAT_COFF'
  1085.      Define this macro if the system uses COFF (Common Object File
  1086.      Format) object files, so that `collect2' can assume this format
  1087.      and scan object files directly for dynamic constructor/destructor
  1088.      functions.
  1089.  
  1090. `OBJECT_FORMAT_ROSE'
  1091.      Define this macro if the system uses ROSE format object files, so
  1092.      that `collect2' can assume this format and scan object files
  1093.      directly for dynamic constructor/destructor functions.
  1094.  
  1095.    These macros are effective only in a native compiler; `collect2' as
  1096. part of a cross compiler always uses `nm'.
  1097.  
  1098. `REAL_NM_FILE_NAME'
  1099.      Define this macro as a C string constant containing the file name
  1100.      to use to execute `nm'.  The default is to search the path
  1101.      normally for `nm'.
  1102.  
  1103. ə